package com.cyt.web.controller.base;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 *@Author: YuShengQiang
 *@Date: 2018-11-16 17:17
 *@Description:选择器跳转
 */
@RestController
public class BaseSelectorController extends BaseController {
    private static Logger log= LoggerFactory.getLogger(BaseSelectorController.class);
    /**
     *@Author: YuShengQiang
     *@Date: 2018-11-23 9:19
     *@Description:选择器跳转统一跳转处理
     */
    @RequestMapping("/base/selector/*")
    public Model goPage(Model model) {
        return model;
    }

    /**
     *@Author: YuShengQiang
     *@Date: 2018-11-23 9:19
     *@Description:单选选择器跳转统一跳转处理
     */
    @RequestMapping("/base/selector/single")
    public ModelAndView goSinglePage(String url) {
        ModelAndView modelAndView=new ModelAndView("/base/selector/singleSelector");
        modelAndView.addObject("url",url.replace(",","&"));
        return modelAndView;
    }

    /**
     *@Author: YuShengQiang
     *@Date: 2018-11-23 9:19
     *@Description:单选选择器跳转统一跳转处理
     */
    @RequestMapping("/base/selector/singleLeaf")
    public ModelAndView goSinglePageLeaf(String url) {
        ModelAndView modelAndView=new ModelAndView("/base/selector/singleSelectorIsLeaf");
        modelAndView.addObject("url",url.replace(",","&"));
        return modelAndView;
    }

    /**
     *@Author: YuShengQiang
     *@Date: 2018-11-23 9:19
     *@Description:多选选择器跳转统一跳转处理
     */
    @RequestMapping("/base/selector/mult")
    public ModelAndView goMultPage(String url) {
        ModelAndView modelAndView=new ModelAndView("/base/selector/multSelector");
        modelAndView.addObject("url",url);
        return modelAndView;
    }

    /**
     *@Author: YuShengQiang
     *@Date: 2018-11-23 9:19
     *@Description:多选选择器跳转统一跳转处理(仿e智云）
     */
    @RequestMapping("/base/selector/cytMult")
    public ModelAndView goCytMultPage() {
        ModelAndView modelAndView=new ModelAndView("/base/selector/cytMultSelector");
        return modelAndView;
    }
}
